<template>

</template>



<script>

import axios from "axios";


export default {
  name: 'index',
  data(){
    return {
      data:{
        account_number:'',
        role_type:'',
        role_id:'',
      }
    }
  },
  created: function() {
      var _this=this
       // console.log(JSON.parse(localStorage.getItem("Token"))[0]["Token"])
      console.log(JSON.parse(localStorage.getItem("Token")))
      axios.post('http://localhost:8080/getLoginInfo',JSON.parse(localStorage.getItem("Token"))[0])
        .then(function (response) {
          console.log(response.data)
          console.log(response.data.account_number)
          console.log(response.data.role_type)
          console.log(response.data.role_id)
          //commit调用mutation中的函数，而第二个参数为commit调用方法中的入参
          _this.loading = false
          localStorage.getItem("Token")
          // console.log(_this.$store.getters.get_Token)
          if(response.data.role_type === 'student'){
            _this.$router.replace('/Back/Student')
          }
          else if(response.data.role_type === 'company'){
            _this.$router.replace('/Back/Company')
          }
          else{
            _this.$router.replace('/Back/Manage')
          }
        })
        .catch(function (error) {
          console.log(error);
        });

  },
  method :{

  }

}
</script>

<style scoped>

</style>
